﻿using Best.SmartCms.Domain;
using Best.SmartCms.Dto.Response;
using Best.SmartCms.Dto;
using Best.SmartCms.Service;
using Microsoft.AspNetCore.Mvc;

namespace Best.SmartCms.API.Controllers
{
    /// <summary>
    /// WeixinSetting
    /// </summary>
    public class WeixinSettingController : Controller
    {
        private readonly WeixinSettingService _weixinSettingService;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="weixinSettingService"></param>
        public WeixinSettingController(WeixinSettingService weixinSettingService)
        {
            _weixinSettingService = weixinSettingService;
        }

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("weixinsetting/edit")]
        public ApiResponse Edit([FromBody]WeixinSettingEditDto dto)
        {
            _weixinSettingService.Edit(dto);
            return ApiResponse.Succeeds();
        }


        /// <summary>
        /// 详情
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Route("weixinsetting/Info")]
        public ApiResponse<WeixinSettingEditDto> Info()
        {
            var ret = _weixinSettingService.Info(1);
            return ApiResponse<WeixinSettingEditDto>.Succeeds(ret);
        }
    }
}